home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1995 #5 & #6
/
Amiga Plus CD - 1995 - No. 5 and 6.iso
/
pd
/
serien
/
purity
/
nr.10
/
medplayerlibrary
/
medplay1.0b.p
< prev
next >
Wrap
Text File
|
1995-04-19
|
2KB
|
75 lines
program medplay;
{
* Medplay.p , 1993 by Diesel, (P)1993 in the Pascal-FD-Serie *
* "Purity". Feel free 2 spread this ! [ This version 1.0b is *
* only 4 use in CLI. ] Bernd K., 1993 *
}
{
* This example uses the medplayer.library . Compiled with PCQ- *
* Pascal V1.2 . *
}
{$I "Include:Libraries/medplayer.i" }
{$I "Include:libraries/dos.i" }
{$I "Include:exec/Libraries.i" }
{$I "Include:utils/Parameters.i" }
{$I "Include:Diesel/LMB.i" }
VAR
buf : Array[0..99] of Char;
name : String;
module : MMD0Ptr; {
* Ptr auf einen Medsong-Record *
}
{
* Zum sauberen Verlassen des Programms : *
}
Procedure CleanExit( why : String; rt : Integer);
BEGIN
{
* Song adios *
}
IF module <> NIL THEN UnloadModule( module );
{
* Library zu *
}
IF MEDPlayerBase <> NIL THEN CloseLibrary( MEDPlayerBase );
{
* ggf. Msg ausgeben *
}
IF why <> NIL THEN write( why );
{
* Bye ! *
}
Exit( rt );
END;
BEGIN
name := Adr( buf ); {
* CLI-Parameter holen *
}
GetParam( 1, name );
IF buf[0] = chr(0) THEN {
* Kein Parameter ? -> Bye ! *
}
CleanExit("Medplay 1.0b, 1993 by Diesel\nUsage: Medplay med-modulename\n\n",0);
{
* Library aufmachen, logo *
}
MEDPlayerBase := OpenLibrary( medname, 0 );
IF MEDPlayerBase = NIL THEN
CleanExit("Cannot open medplayer.library\n", 10);
IF GetPlayer(0) = 0 THEN BEGIN {
* Player installieren *
}
module := LoadModule( name ); {
* Song laden *
}
IF module = NIL THEN
CleanExit("Cannot load module\n",0);
write("Module address = ", Integer(module), "\n\n" );
PlayModule(module); {
* Sound an - yeah ! *
}
write("Press left MB...\n");
repeat {
* Auf linke Maus- *
}
Delay(10); {
* taste warten *
}
Until LeftMouseButton;
FreePlayer; {
* Player adios *
}
END ELSE CleanExit("Cannot init player\n",0);
CleanExit( NIL, 0 );
END.